﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Kardex_DataAccess;
using Kardex_Entity;
namespace Kardex_BussinesLogic
{
    public class SupervisorFactory
    {
        SupervisorDA manager;
        public SupervisorFactory()
        {
            manager = new SupervisorDA();
        }
       
       public List<person> GetListSupervisor()
       {
           List<person> listManager = new List<person>();
           listManager = null;
           try
           {
               listManager = manager.GetListSupervisor();
           }
           catch (Exception )
           {
               listManager = null;
           }
           return listManager;
       }
       public person GetObjByIdperson( int Idperson)
       {
           return manager.GetObjByIdperson(Idperson);
       }

       public person Save( person objPerson )
       {
           try
           {                              
              return manager.Save(objPerson);
           }
           catch (Exception ex)
           {               
               throw new Exception(ex.Message.ToString());
           }
       }

       public  bool Update(person objPerson)
       {
           try
           {
               return manager.Udate(objPerson);
           }
           catch (Exception ex)
           {
               throw new Exception(ex.Message.ToString());
           }
       }

       public bool Delete(person objPerson)
       {
           try
           {
              return manager.Delete(objPerson);
           }
           catch (Exception ex)
           {
               throw new Exception(ex.Message.ToString());
           }
       }
    }
}
